<template>
	<!-- user的组件 -->
	<view class="row-item" @click="gotoDetails">
		
		<view class="left">
			<slot name="icon"></slot>
			<view class="text">
				<slot name="text"></slot>
			</view>
		</view>
		
		<view class="right">
			<view class="text">
				<slot name="value"></slot>
			</view>
			<uni-icons type="right" size="16" color="#aaa"></uni-icons>
		</view>
		
		<!-- <button open-type="contact" class="contact-btn">联系客服</button> -->
		<view class="contact">
			<slot name="customer-service"></slot>
		</view>
	</view>
</template>

<script setup>
import { myDownloadOrScoreAPI } from '@/api/user.js'

const props = defineProps({
	type: {
		type: String,
		default: ''
	},
	name: {
		type: String,
		default: ''
	}
})

const gotoDetails = () => {
	if(props.type && props.name) {
		uni.navigateTo({ url: `/pages/class-list/class-list?type=${props.type}&name=${props.name}` })
	} else {
		return;
	}
};

</script>

<style lang="scss" scoped>
.row-item {
	position: relative;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 0 30rpx;
	height: 100rpx;
	background-color: #fff;
	border-bottom: 1px solid #eee;
	&:last-child {
		border-bottom: none;
	}
	
	.left {
		display: flex;
		align-items: center;
		
		.text {
			font-size: 32rpx;
			color: #333;
			padding-left: 20rpx;
		}
	}
	
	.right {
		display: flex;
		align-items: center;
		
		.text {
			font-size: 32rpx;
			color: #aaa;
			padding-right: 20rpx;
		}
	}
	
	.contact {
		position: absolute;
		top: 0;
		right: 0;
		width: 100%;
		height: 100%;
		opacity: 0;
	}
}
</style>